package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsUser;
import com.qf.vo.DayStatis;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsUserMapper extends BaseMapper<DtsUser> {


    /**
     * 统计最近多少天内的用户增长量
     * @return
     */
    @Select("select date_format(a.add_time,\"%y-%m-%d\") as dayStr,\n" +
            "count(*) as cnts\n" +
            "from dts_user a\n" +
            "where a.deleted = 0\n" +
            "group by date_format(a.add_time,\"%y-%m-%d\")")
    public List<DayStatis> staticIncreaseUser();

}
